<?php session_start();
/**
* @package		ReservatieComponent voor ouderavonden.
* @copyright	Copyright (C) 2008 Kristof Beckers. All rights reserved.
* @Version		0.1
* @license		GNU/GPL, see LICENSE.php
**/
?>

<head>
<link rel="stylesheet" href="../../css/template_css.css" type="text/css"/> 
</head>
<?php 
include ("../../include/config.php");
require_once ("../../include/db.php");
include ("../../include/header.php");
$status = $_GET['stat'];
$idedit = $_GET['id'];

if(isset($_SESSION['myusername'])){
	if ($_SESSION['admin'] == "$adminid") {

?>
<body>
<div align="center"><img src="<?php echo "../$logo" ; ?>" /><br><br />
<a href="../index.php"/><img src="<?php echo "../$home" ; ?>" border="0"/></a><br /><br />


<?php	
$lknaam = $_POST['LKnaam'];
$LKID = $_POST['LKID'];
$Ktit = $_POST['Klastitularis'];
$Klas = $_POST['Klas'];
$Vak = $_POST['Vak'];
$Lokaal = $_POST['Lokaal'];

if ($status == "update"){

$sqlupdate = "UPDATE $tbvak SET Klas = '$Klas', Vak = '$Vak', LeerkrachtID = '$LKID', Leerkrachtnaam = '$lknaam', Klastitularis = '$Ktit', Lokaal = '$Lokaal' WHERE OpdrachtID='$idedit'";
mysql_query($sqlupdate) or die(mysql_error());
?>
<script language="JavaScript">
<!--
 window.location="opdrachten.php?klas=<?php echo $Klas ; ?>";
//-->
</script>
<?php
}

if ($status == "delete"){

$sqldelete = "DELETE FROM $tbvak WHERE OpdrachtID='$idedit'";
mysql_query($sqldelete) or die(mysql_error());
echo " Het record is verwijderd";
}

mysql_close($conn);
}}
?>
</div>
</body>
